<?php
$result = $model->getPelangganList();

$id_pelanggan = '<select name="pelanggan_id" id="pelanggan_id">';
if( count($result) > 0 ){
	foreach($result as $x)
		$id_pelanggan .= '<option value="'.$x['Id'].'">'.$x['Id'].'</option>';
}
$id_pelanggan .= '</select>';	
?>

<script type="text/javascript">
$(document).ready(function(){	
	// VALIDATOR	
	// validation config
	<?php require('library/js/validator/config.kontrak.js');?>	
});

</script>
<div class="title">Kontrak</div>
<form name="frm_<?=$subbagian;?>" id="frm_<?=$subbagian;?>" method="post" action="index.php?bagian=<?=$bagian;?>&subbagian=<?=$subbagian;?>&action=confirm">
    <ul>
		<li><span>
            <label>Nomor Kontrak:</label>
            <input type="text" id="no_kontrak" name="no_kontrak" value=""/>
        </span></li>
		<li><span>
            <label>ID Pelanggan:</label>
            <?=$id_pelanggan;?>
        </span></li>		
		<li><span>
            <label>Person in Charge:</label>
            <input type="text" id="pic" name="pic" value=""/>
        </span></li>
		<li><span>
            <label>Jumlah Pesanan:</label>
            <input type="text" id="jml_pesan" name="jml_pesan" value=""/>
        </span></li>
		<li><span>
            <label>Harga per biji:</label>
            <input type="text" id="harga_per_biji" name="harga_per_biji" value=""/>
        </span></li>		
		<li><span>
            <label>Nilai total:</label>
            <input type="text" id="nilai_total" name="nilai_total" value=""/>
        </span></li>		
	</ul>
	<ul>
		<li class="header"><span>Simpan</span></li>
		<li class="button"><span>
			<input type="submit" name="submit" id="submit" value="Simpan Data" class="simpan"/>
		</span></li>
	</ul>
</form>